﻿using YNTK.Common.Helper;
using YNTK.Common.Model;
using YNTK.SubDev.Entitys.Dto.ZyOaWfSeal;
using Mapster;
using System.Collections.Generic;

namespace YNTK.SubDev.Entitys.Mapper.ZyOaWfSeal
{
	public class Mapper : IRegister
	{
		public void Register(TypeAdapterConfig config)
		{
			config.ForType<ZyOaWfSealCrInput, ZyOaWfSealEntity>()
				.Map(dest => dest.SealType, src => src.sealType.ToJson())
				.Map(dest => dest.SealFile, src => src.sealFile.ToJson())
				;
			config.ForType<ZyOaWfSealEntity, ZyOaWfSealInfoOutput>()
				.Map(dest => dest.sealType, src => src.SealType.ToObject<List<string>>())
				.Map(dest => dest.sealFile, src => src.SealFile.ToObject<List<FileControlsModel>>())
				;
			config.ForType<ZyOaWfSealEntity, ZyOaWfSealCrInput>()
				.Map(dest => dest.sealType, src => src.SealType.ToObject<List<string>>())
				.Map(dest => dest.sealFile, src => src.SealFile.ToObject<List<FileControlsModel>>())
				;
		}
	}
}